import axios from 'axios'
import { Toast } from 'vant'
import localCache from './localCache'
const request = axios.create({
  baseURL: 'http://139.155.10.41:8005/'
})
// 配置请求拦截器
request.interceptors.request.use(config => {
  config.headers.Authorization = `${localCache.getLocalCache('miBlogToken')}`
  return config
})
// 配置响应拦截器
request.interceptors.response.use(
  res => {
    Toast.success(res.data.msg)
    return res
  },
  err => {
    console.dir(err)
    if (err) {
    }
  }
)
export default request
